package server;

import java.util.HashMap;
import java.util.Map;


public class Mapper {
    /**
     * 定义socket监听的端口号
     */
    private int port = 7070;

    Map<String, MappedHost> hostMap = new HashMap<>();

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public Map<String, MappedHost> getHostMap() {
        return hostMap;
    }

    public void setHostMap(Map<String, MappedHost> hostMap) {
        this.hostMap = hostMap;
    }

    public class MappedHost {
        private String name;
        private String appBase;
        Map<String, MappedContext> contextMap = new HashMap<>();

        public String getAppBase() {
            return appBase;
        }

        public void setAppBase(String appBase) {
            this.appBase = appBase;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Map<String, MappedContext> getContextMap() {
            return contextMap;
        }

        public void setContextMap(Map<String, MappedContext> contextMap) {
            this.contextMap = contextMap;
        }
    }

    public class MappedContext {
        private String name;
        Map<String, HttpServlet> servletMap = new HashMap<>();

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public Map<String, HttpServlet> getServletMap() {
            return servletMap;
        }

        public void setServletMap(Map<String, HttpServlet> servletMap) {
            this.servletMap = servletMap;
        }
    }
}
